/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet.registration;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author HONEY
 */
@WebServlet(name = "addtoseekerbean", urlPatterns = {"/addtoseekerbean"})
public class addtoseekerbean extends HttpServlet {

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        AO.Seeker s=new AO.Seeker();
        s.setFname(request.getParameter("fname"));
        s.setLname(request.getParameter("lname"));
        s.setDob(request.getParameter("dob"));
        s.setGender(request.getParameter("gender"));
        s.setEmail(request.getParameter("email"));
        s.setContact(request.getParameter("contact"));
        s.setStatus(request.getParameter("status"));
        s.setAddress(request.getParameter("address"));
        s.setUsername(request.getParameter("username"));
        s.setPassword(request.getParameter("password"));
        
        
        AO.Login login=new AO.Login(s.getUsername(),s.getPassword(),"seeker",true);
        request.getSession().setAttribute("logindata", login);
        request.getSession().setAttribute("seekerdata", s);
        
            response.sendRedirect("qualificationsform.jsp");
        
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

   
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

   
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
